#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>

typedef int HPtype;

typedef struct Heap
{
	HPtype* a;
	int size;
	int capacity;
}HP;


void AdjustUp(HPtype* a, int child);
void Swap(HPtype* p1, HPtype* p2);
void AdjustDown(HPtype* a, int n, int parent);

void HPinit(HP* php);
void HPdestroy(HP* php);
void HPpush(HP* php, HPtype x);
void HPpop(HP* php);
HPtype HPtop(HP* php);
bool HPempty(HP* php);
